//
//  YTAccountSelectViewController.m
//  YiTuDriverClient
//
//  Created by 石少庸 on 2017/5/27.
//  Copyright © 2017年 Yitu. All rights reserved.
//

#import "YTAccountSelectViewController.h"
#import "YTWithdrawAccountModel.h"
#import "YTWithdrawAccountCell.h"

@interface YTAccountSelectViewController ()

@end

@implementation YTAccountSelectViewController

- (void)initialize {
    self.navigationItem.title = @"选择提现账户";
    self.tableView.tableFooterView = [UIView new];
    [self.tableView reloadData];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    YTWithdrawAccountCell *cell = [tableView dequeueReusableCellWithIdentifier:@"YTWithdrawAccountCell" forIndexPath:indexPath];
    cell.model = _accountList[indexPath.row];
    return cell;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return _accountList.count;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    [_callBackAction sendNext:_accountList[indexPath.row]]; // 发送数据
    [_callBackAction sendCompleted];
    [self.navigationController popViewControllerAnimated:YES];
}

@end
